package codeCreate.restfulAPICreate.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import codeCreate.restfulAPICreate.domain.ApplyMessageCodeRequest;
import codeCreate.restfulAPICreate.domain.CommonResponse;
import codeCreate.restfulAPICreate.util.annotation.type.Method;

/**
 * 
* 项目名称:  SPMS权限申请
* 包:        com.migu.spms.webapi 
* 类名称:    PermitMessageController.java
* 类描述:    短信验证码发送次数控制类
* 创建人:    fw  
* 创建时间:  2017年5月16日 下午1:36:21
 */
@codeCreate.restfulAPICreate.util.annotation.type.Controller(introduction="短信验证码发送次数申请")
@Controller
@RequestMapping(value = "/account", produces = "application/json;charset=UTF-8")
public class ApplyMessageCodeController {
    private static Logger logger = LoggerFactory.getLogger(ApplyMessageCodeController.class);
    @Resource(name = "messageApplyService")
//    private IMessageApplyService messageApplyService;

    /**
     * @Description 申请短信验证码发送次数
     * @param request
     * @param response
     * @param sessionId
     * @return
     * @throws Exception
     */
    @Method(introduction="申请短信验证码发送次数",requestType=ApplyMessageCodeRequest.class,responseType=CommonResponse.class)
    @ResponseBody
    @RequestMapping(value = "/applyMessageCode")
    public String applyAccount(HttpServletRequest request, HttpServletResponse response, String sessionId)
            throws Exception {
        // User user = getUserBySession(request, sessionId);
        // if (user == null) {
        // return generateResponse(401);
        // }
//        ApplyMessageCodeRequest reqMsg = ParseMsg(request, ApplyMessageCodeRequest.class);
        // reqMsg.setCreateUid(String.valueOf(user.getUserId()));
        // reqMsg.setCreateName(user.getUserName());
//        messageApplyService.apply(reqMsg);
//        return generateResponse(200);
        return null;
    }

}

